<%inherit file="base_html.html"/>

<%def name="page_actions()">
    <div class="page_actions">
        <ul class="nav">
            % for nav in c.nav_items:
            <li><a href="${nav.url}${('?method=%s'%nav.method) if nav.method != 'GET' else ''}">${nav.title}</a></li>
            % endfor
        </ul>
        <ul>
            % for action in c.page_actions:
            <li><a href="${action.url}${('?_method=%s'%action.method) if action.method !='GET' else ''}">${action.title}</a></li>
            % endfor
        </ul>
    </div>
</%def>

<div id="header">
    <div id="user_info" class="page_actions">
        % if c.user:
            Logged in as: ${c.user.username} 
            <a href="${h.url_for('logout')}">(logout)</a>
        % else:
            <a href="${h.url_for('login_form')}">Not logged in</a>
        % endif
    </div>
    <h1><a href="/">${c.config['mtp.title']}</a></h1>
    <img src="/images/logo.png"/>
    <hr/>
    ${page_actions()}
</div>

<div id="content">
    <div id="content_prepend">
        % for thing in c.content_prepend:
            ${thing}
        % endfor
    </div>

    ${next.body()}

    <div id="content_append">
        % for thing in c.content_append:
            ${thing if thing else ''}
        % endfor
    </div>
</div>

<div id="footer">
    ${page_actions()}
    <hr/>
    <p>MTP created by Dunk Fordyce</p>
</div>

<%def name="headContent()">
    ${parent.headContent()}
    <link rel="stylesheet" type="text/css" href="/css/mtp.css"/>
    <script src="/js/jquery-1.2.3.js"></script>
    <title>${c.config['mtp.title']}</title>
    % for thing in c.content_head:
        ${thing}
    % endfor
</%def>


